﻿#region Imports
using System.Drawing;
using System.IO;
using System.Windows.Forms;
using CommonUtilities.Extensions;
#endregion

namespace DirectoryAnalyzer.Events
{
    public static class AddressLeaveEvent
    {
        #region Events
        public static void _TextLeave(object sender, string sBasePath)
        {
            TextBox txtPath = (TextBox)sender;
            if (txtPath.IsNull()) return;
            else if (txtPath.Text != sBasePath) txtPath.Text = sBasePath;
            txtPath.ForeColor = Directory.Exists(sBasePath) ? Color.Black : Color.Red;
        }
        #endregion
    }
}
